/* 水库蓄水动态评价 */
Ext.create('Ext.data.Store', {
    storeId: 'dews_store1',
    fields: ['regNm', 'larResNum', 'larResYsw', 'larResYew', 'midResNum', 'midResYsw', 'midResYew'],
    data: []
});

Ext.define('Admin.view.evaluation.dews.Dews', {
    extend: 'Ext.panel.Panel',
    xtype: 'dews',
    requires: ['Admin.view.evaluation.dews.DewsController'],
    controller: 'dewsController',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    // userCLs: 'big-100 small-100',
    height: 200,
    margin: 10,
    items: [{
        height: 46,
        xtype: 'toolbar',
        layout: {
            type: 'hbox',
            align: 'stretch'
        },
        cls: 'shadow',
        margin: '0 0 10 0',
        border: 1,
        style: {
            borderColor: '#ccc',
            borderStyle: 'solid'
        },
        items: [{
            xtype: 'component',
            id: 'dewsComboWrapper',
            maxWidth: 220,
            width: '15%'
        }, {
            xtype: 'component',
            width: '65%',
        }, {
            xtype: 'segmentedbutton',
            id: 'dewsSwitchBtns',
            cls: 'x-box-item my-top-nav',
            docked: 'right',
            width: '20%',
            minWidth: 200,
            maxWidth: '20%',
            items: [{
                id: 'dewsBtn1',
                text: '行政分区',
                pressed: true,
                listeners: {
                    "click": 'switchAdminRegion'
                }
            }, {
                id: 'dewsBtn2',
                text: '水资源分区',
                listeners: {
                    "click": 'switchWaterRegion'
                }
            }]
        }]
    }, {
        flex: 1,
        title: '水库蓄水动态评价',
        xtype: 'grid',
        reference: 'dewsGrid',
        cls: 'shadow',
        style: 'border: 1px solid #ccc',
        // autoScroll: true,
        loadMask: true,
        stripeRows: true,
        columnLines: true,
        forceFit: true, //表格自适应
        columns: [{
            text: '分区',
            dataIndex: 'regNm',
            editor: 'textfield',
            align: 'center',
            style: 'background: #EEEEEE',
            width: '16%'
        }, {
            text: '中型水库',
            align: 'center',
            style: 'background: #EEEEEE',
            width: '40%',
            columns: [{
                text: '水库座数',
                dataIndex: 'midResNum',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '33%'
            }, {
                text: '年初蓄水总量',
                dataIndex: 'midResYsw',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '33%'
            }, {
                text: '年末蓄水总量',
                dataIndex: 'midResYew',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '34%'
            }]
        }, {
            text: '大型水库',
            align: 'center',
            style: 'background: #EEEEEE',
            width: '40%',
            columns: [{
                text: '水库座数',
                dataIndex: 'larResNum',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '33%'
            }, {
                text: '年初蓄水总量',
                dataIndex: 'larResYsw',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '33%'
            }, {
                text: '年末蓄水总量',
                dataIndex: 'larResYew',
                editor: 'textfield',
                align: 'center',
                style: 'background: #EEEEEE',
                width: '34%'
            }]
        }],
        store: Ext.data.StoreManager.lookup('dews_store1')
    }],
    listeners: {
        afterrender: 'initData'
    }
});